package com.ruoyi.blog.controller;

import com.ruoyi.blog.domain.BlogArticle;
import com.ruoyi.blog.mapper.BlogArticleMapper;
import com.ruoyi.blog.service.IBlogArticleService;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/blog/home")
public class BlogHomeController extends BaseController {
    @Autowired
    private IBlogArticleService articleService;
    @GetMapping(value = "/list")
    public TableDataInfo getArticleByState(BlogArticle article) {
        startPage();
        List<BlogArticle> articles = articleService.getArticleList(article);
        return getDataTable(articles);
    }
}
